# -*- encoding: utf-8 -*-
"""
@File    :   test_momentum 
@Modify Time      @Author    @Version    @Desciption
------------      -------    --------    -----------
2025/1/23 14:03   libowen    None         None
"""
import numpy as np
from utils.numeric import penta_diagonal_solve, thomas_algorithm



def test_penta_diagonal_solve():
    a_e = np.asarray([112517.46591868567, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545,
                      112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112545.03493210545, 112517.46591868567])
    a_ee = np.asarray([-0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0,
                       -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0,
                       -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0,
                       -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0, -0.0])
    a_w = np.asarray([-55.138026839559245, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849, -110.27605367911849,
                      -110.27605367911849, -55.138026839559245])
    a_eee = np.asarray([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0])
    a_ww = np.asarray([0.0, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623,
                       27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 27.569013419779623, 0.0])
    b = np.asarray([153542.40911773304, 153432.9251834589, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695,
                    153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695, 153469.41982821695])

    correct_result = np.asarray([1.3646095551840387, 1.3646395776825593, 1.364629599600278, 1.364629582469054, 1.3646295848964975, 1.3646295849030725, 1.3646295849024843, 1.3646295849024819,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482, 1.364629584902482,
                                 1.3646295849024823])



    result = penta_diagonal_solve(a_e, a_ee, a_w, a_eee, a_ww, b)

    assert  np.sum(np.abs(result - correct_result)) < 1e-5



def test_thomas_algorithm():
    a_W = np.asarray([-4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06])
    a_P = np.asarray([0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437, 0.00027231313288744437,
                      0.00027231313288744437])
    a_E = np.asarray([-4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06, -4.080349383528972e-06,
                      -4.080349383528972e-06])
    RHS_b = np.asarray([0.022423400961824557, 4.421216682416779e-05, -1.4626206575876715e-05, -6.458138805190276e-08, 9.036712921813872e-09, 6.2288568197703e-11, -5.43532009931491e-12,
                        -5.171243590253955e-14, 3.302835482624183e-15, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                        0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
                        -1.1617430469277915e-17, -0.022452931434202544])

    correct_result = np.asarray([82.36509567080354, 1.3960277247407518, -0.032803771042544685, -0.0007283575490695703, 2.227969834820978e-05, 5.624056406321416e-07, -1.1538145266097879e-08,
                                 -3.626882686046474e-10, 6.695784676083573e-12, 1.00352405039742e-13, 1.5040216620512397e-15, 2.254137465886876e-17, 3.3783660457290665e-19, 5.063292417458906e-21,
                                 7.588559012753243e-23, 1.1373277137120012e-24, 1.704558567975162e-26, 2.5546901536185397e-28, 3.828816388954151e-30, 5.738400376875166e-32, 8.600370333850281e-34,
                                 1.2889719263480577e-35, 1.9318338192648636e-37, 2.895316669796681e-39, 4.339326982893663e-41, 6.503523038048652e-43, 9.747090291459155e-45, 1.4608354363324177e-46,
                                 2.189412540801503e-48, 3.2813602097807477e-50, 4.917905888303095e-52, 7.370662402169586e-54, 1.1046706765163726e-55, 1.6556141591777973e-57, 2.481335209072492e-59,
                                 3.718876397409224e-61, 5.573628911015611e-63, 8.35342074271436e-65, 1.2519606026676702e-66, 1.876363467025226e-68, 2.812181032601949e-70, 4.2147282757876477e-72,
                                 6.316781968438204e-74, 9.467213975811808e-76, 1.418889252654807e-77, 2.1265461163580407e-79, 3.1871397831329097e-81, 4.7766939560013604e-83, 7.158972016632319e-85,
                                 1.0393086355108533e-86, -2.2286522843953204e-86, -1.4977443610529809e-84, -9.993372726098033e-83, -6.66784936140591e-81, -4.448969963286665e-79, -2.9684734404455613e-77,
                                 -1.9806460010624545e-75, -1.3215407381027013e-73, -8.817678280360017e-72, -5.883394133392992e-70, -3.925560156344218e-68, -2.6192402194530824e-66,
                                 -1.7476281228586695e-64, -1.1660648890174185e-62, -7.780301241519697e-61, -5.191228033613206e-59, -3.463728159156446e-57, -2.31109338346342e-55,
                                 -1.5420241952212496e-53, -1.0288803713696319e-51, -6.864968927662153e-50, -4.580493484877251e-48, -3.0562295017040865e-46, -2.0391992255691897e-44,
                                 -1.3606090377844293e-42, -9.078352573343786e-41, -6.057323092616084e-39, -4.041610275863718e-37, -2.696672007124599e-35, -1.7992927119761278e-33,
                                 -1.2005369043091132e-31, -8.010307878283847e-30, -5.34469470072826e-28, -3.5661252823296924e-26, -2.3794155216271183e-24, -1.5876105790824622e-22,
                                 -1.059296843239448e-20, -7.067915878625397e-19, -4.7159051956159634e-17, -3.1465798682316712e-15, -2.099483440923506e-13, -1.4008323015138135e-11,
                                 -9.346733099744342e-10, -6.236393859810992e-08, -4.161091149136597e-06, -0.0002776392886761594, -0.018524846453459257, -1.2360280051160846, -82.47114130038611])

    result = thomas_algorithm(
        a_W,  # 下对角
        a_P,  # 主对角
        a_E,  # 上对角
        RHS_b  # 右侧向量
    )

    assert np.sum(np.abs(result - correct_result)) < 1e-5





